package com.by.service.impl;

import com.alibaba.csp.sentinel.SphO;
import com.by.service.OrderService;

import java.util.HashMap;
import java.util.Map;

//@Service
public class OrderServceImpl2 implements OrderService {
    @Override
    public Map get() {
        Map map = new HashMap();
        if(SphO.entry("查询订单信息")){
            //true 说明在规则 内访问
            try {
                Thread.sleep(1100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            map.put("id", "1");
            map.put("orderNum", "dd20240002222222222222");
            SphO.exit();//退出
        }else{
            map.put("code",0);
            map.put("msg","查询订单失败");
        }
        return map;
    }
}
